package report.view
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import ui.report.PlotCaseUI;
	import vo.GeneralVO;
	
	/**
	 * ...
	 * @author WLDragon 2014-05-01
	 */
	public class PlotCase extends PlotCaseUI
	{
		
		public function PlotCase()
		{
			super();
			this.y = 84;
			
			caseBmp = new Bitmap();
			caseBmp.x = -112;
			caseBmp.y = -80;
			bmpPanel = new Sprite();
			bmpPanel.x = 144;
			bmpPanel.y = 112;
			bmpPanel.addChild(caseBmp);
			addChild(bmpPanel);
		}
		
		public function update(id:int, g:GeneralVO):void
		{
			caseBmp.bitmapData = App.asset.getBitmapData("png.report.plot_"+id);
			btName.text = g.name;
			btKnowledge.text = String(g.knowledge);
			btLoyalty.text = g.loyalty == 100 ? "--" : String(g.loyalty);
			btSoliders.text = String(g.soliders);
			btStrength.text = String(g.strength);
		}
		
		private var caseBmp:Bitmap;
		public var bmpPanel:Sprite;
	}

}